using System;
using UnityEngine;

[Serializable]
public class TTCameraBehaviourStaticCamera : TTCameraBehaviour
{
	public Vector3 lookAtPoint;

	public Vector3 position;

	public override void Start(Camera cam, TTCameraController camController, TTCameraOptions cameraOptions)
	{
		base.Start(cam, camController, cameraOptions);
		camera.transform.rotation = Quaternion.LookRotation(lookAtPoint - position);
		camera.fieldOfView = fov;
		camera.transform.position = position;
	}

	public override void Update()
	{
		Vector3 vector = position;
		Quaternion b = Quaternion.LookRotation(lookAtPoint - vector);
		camera.transform.position = Vector3.Lerp(camera.transform.position, vector, RealTime.deltaTime * moveSpeed);
		camera.transform.rotation = Quaternion.Lerp(camera.transform.rotation, b, RealTime.deltaTime * rotationSpeed);
		camera.fieldOfView = Mathf.Lerp(camera.fieldOfView, fov, RealTime.deltaTime * rotationSpeed);
	}
}
